﻿using Domain.Entities;
using FluentMigrator;
using FrameworkCore.Extensions;

namespace AiBLSmartEdu.Module.SmartMaths.API.Migrations;

[Migration(202409241507)]
public class MathQuestionAddColumn : ForwardOnlyMigration
{
    public override void Up()
    {
        Alter.Table(MigrationExpressions.GetTableName(typeof(MathQuestion)))
          .AddColumn(MigrationExpressions.ColumnNameFor<MathQuestion>(nameof(MathQuestion.Question))).AsString(int.MaxValue).Nullable().WithColumnDescription("问题")
          .AddColumn(MigrationExpressions.ColumnNameFor<MathQuestion>(nameof(MathQuestion.Answer))).AsString(int.MaxValue).Nullable().WithColumnDescription("答案")
          .AddColumn(MigrationExpressions.ColumnNameFor<MathQuestion>(nameof(MathQuestion.Status))).AsInt32().Nullable().WithColumnDescription("状态：0待查看；1已解决；2未解决")
          .AddColumn(MigrationExpressions.ColumnNameFor<MathQuestion>(nameof(MathQuestion.IsFavorited))).AsBoolean().Nullable().WithDefaultValue(true).WithColumnDescription("是否收藏");
    }
}